/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import javax.swing.*;

/**
 *
 * @author sun
 */
public class ChatPanel extends JFrame {

    JList chatList;
    DefaultListModel model;
    JButton se;
    JTextField send;
    JTextPane mainText;
    JScrollPane p1, p2;

    public ChatPanel() {
        model = new DefaultListModel();
        chatList = new JList(model);
        chatList.setSize(85, 285);
//        chatList.setLocation(10, 10);
        p1 = new JScrollPane(chatList);
        p1.setLocation(10, 10);
        p1.setSize(92, 285);
        mainText = new JTextPane();
        mainText.setSize(300, 285);
//        mainText.setLocation(110, 10);
        p2 = new JScrollPane(mainText);
        p2.setLocation(110, 10);
        p2.setSize(307, 285);
        se = new JButton("发送");
        se.setSize(65, 25);
        se.setLocation(285, 350);
        send = new JTextField();
        send.setSize(265, 25);
        send.setLocation(10, 350);
        this.setLayout(null);

        this.add(p1);
        this.add(se);
        this.add(p2);
        this.add(send);
//        this.setSize(370, 450);
        this.setResizable(false);
        this.setVisible(true);
        this.pack();
        this.setSize(430, 500);
        this.show();
        this.setDefaultCloseOperation(2);
    }

    public static void main(String[] args) {
        ChatPanel cl = new ChatPanel();
    }
    
}
